package winter_vacation_homework.day_04;

/**
 * 给定一个3乘以3的二维数组，里面的数据随机生成。分别求出两个对角线的元素之和。
 */
public class Question2 {
    public static void main(String[] args) {
        int[][] array = new int[3][3];
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array.length; j++) {
                array[i][j] = (int)(Math.random() * 100 + 1);
            }
        }
        //System.out.println(array[0][0]);测试
        //System.out.println(array[array.length -1][array.length - 1]);
        System.out.println(array[0][0] + array[array.length -1][array.length - 1]);
        System.out.println(array[0][array.length - 1] + array[array.length - 1][0]);
    }

}
